<template>
  <div>
    组件一
    <my-btn></my-btn>
    <div v-for="item in  list" :key="item.id">
            {{ item.id }}
        </div>
     <div v-bind:[myid]="id">你好{{ num }}</div>
     <button @click="update">修改</button>
  </div>
</template>

<script>
import  {bannerQuery} from  "@/model/bannerModel"
export default {
    name:"childView1",
    props:{
        num:{
            type:Number,
            default: 100,
            required:true
        }
    },
    methods:{
        update(){
            //this.num++;
            this.$emit("update:num",1);
        }
    },
    data(){
        return  {
            id:"tr",
            myid:"class",
            list:[]
        }
    },
  async  created(){
    let res  = await  bannerQuery({});
    this.list = res.data;
    console.log("组件一请求数据")
    },
    activated() {
        console.log("激活访问")
    },
    deactivated() {
        console.log("失效离开");
    },

}
</script>

<style>

</style>